<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/_linkPages/basePath.jsp"%>
<!-- saved from url=(0047)http://www.maomijiaoyi.com/index.php?/userlogin -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>猫咪交易网-用户登录</title>
    <meta name="keywords" content="宠物猫,买猫,卖猫,宠物猫交易,宠物猫价格">
    <meta name="description" content="猫咪交易网(www.maomijiaoyi.com)行业购宠第一品牌，千万家卖猫商家入驻覆盖全国各地，买放心宠物猫、了解最全面的宠物猫价格就上猫咪交易网、12年品牌值得信赖！">
    <script src="https://cdn.bootcss.com/jquery//2.0.2/jquery.min.js" type="text/javascript"></script>
    <script src="https://static.runoob.com/assets/jquery/jquery.growl/javascripts/jquery.growl.js" type="text/javascript"></script>
    <link href="https://static.runoob.com/assets/jquery/jquery.growl/stylesheets/jquery.growl.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="${basePath}jsp/lqj/css/login.css">
    <link rel="stylesheet" href="${basePath}jsp/lqj/css/comment.css">
<%--    <script src="${basePath}jsp/lqj/js/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>--%>
    <script src="${basePath}jsp/lqj/js/comment.js" type="text/javascript" charset="utf-8"></script>
    <script src="${basePath}jsp/lqj/js/layer.js" type="text/javascript" charset="utf-8"></script><link rel="stylesheet" href="${basePath}jsp/lqj/css/layer.css" id="layuicss-layer">
    <style>

        #growls.default {
            top: 80px!important;
            right: 40%!important;//如果准备左边显示，就把这个数值调成80%;
        }
    </style>
</head>
<body>



<!-- 引入公共头部 -->
<!-- 网页头部 -->
<div id="header">
    <div>

        <div class="center_1220">


            <div class="right_float">



                <!-- 未登录 -->
                <a target="_blank" href="${basePath}jsp/lqj/catlogin.jsp" rel="nofollow">登录</a>|
                <a target="_blank" href="${basePath}jsp/lqj/post.jsp" rel="nofollow">免费注册</a>


            </div>

            <div class="center_text">
                您好<strong></strong>，欢迎来到猫咪交易网
            </div>
        </div>

    </div>
    <div class="clearboth"></div>
    <div class="center_1220">
        <!-- 导航栏 nav_box-->

        <%@ page contentType="text/html;charset=UTF-8" language="java" %>
        <div id="nav_box">
            <div class="nav_box_left">

                <a target="_blank" href="http://localhost:8080/jsp/hs/index.jsp">
                    首页
                    <div class="background_color"><span></span></div>
                </a>

                <a target="_blank" href="${basePath}varieties?method=price">
                    买猫卖猫
                    <div class="background_color"><span></span></div>
                </a>


                <a target="_blank" href="http://localhost:8080/jsp/hs/choose.jsp">
                    选猫知识
                    <div class="background_color"><span></span></div>
                </a>


            </div>
            <div class="nav_box_right">
                <a target="_blank" href="${basePath}varieties?method=toIndex">
                    猫咪品种
                    <div class="background_color"><span></span></div>
                </a>
                <a href="http://localhost:8080/jsp/hs/aboutUs.jsp" rel="nofollow">
                    关于我们
                    <div class="background_color"><span></span></div>
                </a>
                <a target="_blank" href="http://localhost:8080/jsp/hs/releaseInformation.jsp">
                    发布信息
                    <div class="background_color"><span></span></div>
                </a>
            </div>

            <div class="logo">
                <a href="http://localhost:8080/jsp/hs/index.jsp">
                    <img title="猫咪交易网" alt="猫咪交易网" src="${basePath}jsp/hs/img/top_logo.png">
                </a>
            </div>
        </div>
    </div>

    <div class="clearboth"></div>
</div>

<div style="height: 80px;"></div>

<!-- 登录框 login_box-->
<form action="${basePath}catlogin" method="post"  onsubmit="return checkLogin(this)">


<div id="login_box" style="border: #eee solid 3px;">

    <div id="Member_login">猫咪会员登录</div>

    <!-- 表单 -->
    <div id="regForm">
        <c:if test="${not empty result and !result}" var="text">
            <input type="hidden" value="isfalse" id="resultLogin">
            <c:remove var="result" scope="session"/>
        </c:if>
        <c:if test="!text">
            <input type="hidden" value="isture" id="resultLogin">
        </c:if>


        <div class="form_box">
            <input type="hidden" name="method" value="login"/>
            <span>用户名：</span>

            <input type="text" name="username" id="username" onblur="ck_name()" placeholder="请输入用户名,3~12字" autocomplete="off">

            <err id="name_err">用户名为空</err>

        </div>

        <div class="form_box">

            <span>密　码：</span>

            <input type="password" name="password" id="password" onblur="ck_pwd()" placeholder="请输入密码" autocomplete="new-password">

            <err id="pwd_err"></err>

        </div>

        <div align="center">
        <button type="submit"   id="submit_form"  status="1" >登　录</button>
            </div>
        <%--        <input type="submit" value="登录"/>--%>
        <img id="loadimg" src="${basePath}jsp/lqj/img/loading-0.gif" style=" display: block; width: 60px; height: 24px; margin: 0 auto; margin-top: 60px; margin-bottom: 19px; display: none; ">
        <!-- 没有帐号立即注册 -->
        <div id="No_account">没有猫咪会员帐号？<a href="${basePath}catlogin?method=toRegPage">立即注册</a></div>


    </div>

</div>

<div style="height: 80px;"></div>
    <ul>
        <li>
            <a class="notice" href="#">提醒!</a>
        </li>
    </ul>
</form>
<!-- 引入公共尾部 -->
<!-- 网页底部 -->
<div id="footer">

    <div class="logo">
        <div class="logo_kuang">
            <div>
                <a href="http://www.maomijiaoyi.com/">
                    <img alt="猫咪交易网" title="猫咪交易网" src="${basePath}jsp/lqj/img/logo.png">
                </a>
            </div>
        </div>
    </div>


    <div class="banquan">
        <div class="center_1220">
            版权所有：猫咪交易网 www.maomijiaoyi.com  友情链接互换:qq 3416807849		</div>
    </div>

    <div class="banquan">
        <div class="center_1220">
            【免责声明：本站所有猫猫交易信息内容系用户自行发布，其真实性、合法性由发布人负责，本站不提供任何保证，亦不承担任何法律责任！】		</div>
    </div>

    <div class="banquan">
        <div class="center_1220">
            <a style="color: #FFF;" href="http://www.beian.gov.cn/portal/registerSystemInfo" target="_blank">
                <img src="${basePath}jsp/lqj/img/foot_link3.png">
                沪ICP备18022709号-1 			</a>
        </div>
    </div>

</div>

<!-- 登录提交验证 -->
<script type="text/javascript">


    var flag = 2;

    function ck_name(){

        var u_name = document.getElementById('username').value;
        if(u_name.length<=0){

            document.getElementById("name_err").innerHTML='用户名为空';
            return false;
        }
        let userReg = /^\w{3,12}$/;
        if (!userReg.test(u_name)) {
            document.getElementById("name_err").innerHTML = '不符合要求';
            //    msgDiv.style.display = 'block';
            return false;
        } else{
            document.getElementById("name_err").innerHTML='';
            return true;
        }
    }

    function ck_pwd(){
        var p_pwd  = document.getElementById('password').value;
        if(p_pwd.length<=0){
            document.getElementById("pwd_err").innerHTML='密码为空';
            return false;




        }
        let pwdReg = /^[a-zA-Z]\w{5,15}$/;
        if (!pwdReg.test(p_pwd)) {
            document.getElementById("pwd_err").innerHTML = '不符合要求';
            //    msgDiv.style.display = 'block';
            return false;
        } else{
            document.getElementById("pwd_err").innerHTML='';
            return true;
        }



    }
//表单验证
    function checkLogin(){
        console.log("123");
        // let username = frm.username.value;
        // let password = frm.password.value;
        var u_name = document.getElementById('username').value;
        var p_pwd  = document.getElementById('password').value;
        let doUsername = document.getElementById("username");


        //用户名和密码的正则表达式
        let userReg = /^\w{3,12}$/;
        let pwdReg = /^[a-zA-Z]\w{5,15}$/;
        if (!userReg.test(u_name)) {
            document.getElementById("name_err").innerHTML = '不符合要求';
            return  false;
        }

        if (!pwdReg.test(p_pwd)) {
            document.getElementById("pwd_err").innerHTML = '不符合要求';
            return  false;
        }else {
            return true;
        }

    }

    //登录返回提示
    function LoginMessage(event) {
        return $.growl.notice({
            title: "${title}",
            message: "${msg}"
        });
    }

    $(function() {

            console.log("${booleans}");
            console.log("${msg}");
            if ("${booleans}" == "true"){
                console.log(1)
                LoginMessage();
            }
        }
        <c:remove var="result" scope="session"/>
        <c:remove var="msg" scope="session"/>
        <c:remove var="booleans" scope="session"/>
        <c:remove var="title" scope="session"/>
    )
</script>




</body></html>